//
//  WZDayPlan.m
//  WZEfengAndEtong
//
//  Created by wanzhao on 16/2/25.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import "WZDayPlan.h"

@implementation WZDayPlan

+ (NSDictionary *)replacedKeyFromPropertyName {
    
    return @{@"scheduleID":@"id"};
}

+ (instancetype)dayPanWithTitlt:(NSString *)title scheduleID:(NSString *)scheduleID startTime:(NSString *)startTime alertFlag:(NSString *)alertFlag alertTime:(NSString *)alertTime beforeLength:(NSString *)beforeLength beforeUnitFlag:(NSString *)beforeUnitFlag {
    
    WZDayPlan *newDayPlan = [[WZDayPlan alloc] init];
    newDayPlan.title = title;
    newDayPlan.startTime = startTime;
    newDayPlan.alertFlag = alertFlag;
    newDayPlan.alertTime = alertTime;
    newDayPlan.beforeLength = beforeLength;
    newDayPlan.beforeUnitFlag = beforeUnitFlag;
    newDayPlan.scheduleID = scheduleID;
    
    return newDayPlan;
}


- (NSString *)startTime {
    
    NSString *str = [NSDate dateStrFromCstampTimeStr:_startTime];
    
    WZLog(@"result = %@ = %@", [str componentsSeparatedByString:@" "].firstObject, [str componentsSeparatedByString:@" "][1]);
    return [str componentsSeparatedByString:@" "].lastObject;
}


- (NSString *)showAlertTime {
    
    return [_showAlertTime componentsSeparatedByString:@" "].lastObject;
}

/**用户数据*/
- (NSMutableArray *)users {
    
    if (!_users ) {
        _users = [NSMutableArray array];
    }
    return _users;
}

@end
